<template>
  <div class="wrapper">
    <FormPanel ref="formPanel" :list="formList" :cols="1" :labelWidth="0" formType="show" :isSubmitBtn="false" />
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import { getXmcxzSelect, getGongzSelect, getWxproductList, getWxtypeSelect, getWxpjList } from '@/api/repair/business/customer';

export default {
  name: 'AddRecordPanel',
  mixins: [dictionary],
  data() {
    this.selectedRows = [];
    return {
      formList: this.createFormList(),
      visible: false,
      activeName: 'first'
    };
  },
  mounted() {
    // this.getXmcxzSelect();
    // this.getGongzSelect();
    // this.getWxtypeSelect();
  },
  methods: {
    createFormList() {
      return [
        {
          type: 'TEXT_AREA',
          rows: 18,
          label: '',
          fieldName: 'MEMO_INFO'
        }
      ];
    },
    initData(data) {
      this.formList.forEach(x => {
        x.initialValue = data[x.fieldName];
      });
    }
    // async getXmcxzSelect() {
    //   const res = await getXmcxzSelect();
    //   this.topFilterList[0].itemList = res.map(x => ({ value: x.MODEL_LABOUR_CODE, text: x.MODEL_LABOUR_NAME }));
    // },
    // async getGongzSelect() {
    //   const res = await getGongzSelect();
    //   this.topFilterList[12].itemList = res.map(x => ({ value: x.WORKER_TYPE_CODE, text: x.WORKER_TYPE_NAME }));
    // },
    // async getWxtypeSelect() {
    //   const res = await getWxtypeSelect();
    //   this.columns[4].filterItems = this.columns[4].editItems = res.map(x => ({ value: x.REPAIR_TYPE_CODE, text: x.REPAIR_TYPE_NAME }));
    // },
    // async getWxpjList(row) {
    //   const res = await getWxpjList(row, { offset: 0, limit: 100 });
    //   this.list = res.rows;
    // },
  }
};
</script>

<style lang="less" scoped>
.wrapper {
  height: calc(100vh - 223px);
}
</style>
